<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 

<script>
$(function(){
	$("#dealerApplySelectId").val("${viewRequest.params['_and_d_dot_state_eq_number']}");
});

</script>

<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${rootUrl}/member/dealer-apply" method="get">
	<div class="searchBar">
		<ul class="searchContent">
			<li style="width: 250px">
				<label>会员名：</label>
				<input type="text" name="viewRequest.params['_and_m_dot_name_like']" value="${viewRequest.params['_and_m_dot_name_like']}"/>
			</li>
			<li style="width: 250px">
				<label>会员手机号：</label>
				<input type="text" name="viewRequest.params['_and_m_dot_mobile_like']" value="${viewRequest.params['_and_m_dot_mobile_like'] }"/>
			</li>
			<li style="width: 250px">
				<label>会员等级：</label>
				<input type="text" name="viewRequest.params['_and_l_dot_level_eq_number']" value="${viewRequest.params['_and_l_dot_level_eq_number'] }"/>
			</li>
			<li style="width: 500px">
				<label>申请时间：</label>
				<input name="viewRequest.params['_and_d_dot_createdAt_ge_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_d_dot_createdAt_ge_date'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_d_dot_createdAt_le_date']" type="text" class="date" size="20" value="${viewRequest.params['_and_d_dot_createdAt_le_date'] }" placeholder="结束时间"/>
			</li>
			<li style="width: 250px">
				<label>状态：</label>
				<select name="viewRequest.params['_and_d_dot_state_eq_number']" id="dealerApplySelectId">
					<option value=''>全部</option>
					<option value='21'>待审核</option>
					<option value='1'>已通过</option>
					<option value='2'>不通过</option>
				</select>
			</li> 
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" targetType="dialog"  width="100%" layoutH="110">
		<thead>
			<tr>
				<th width="2%" align="center" >序号</th>
				<th width="10%" align="center">会员名</th>
				<th width="5%" align="center">会员手机号</th>
				<th width="5%" align="center">会员等级</th>
				<th width="5%" align="center">申请等级</th>
				<th width="5%" align="center">状态</th>
				<th width="10%" align="center">申请时间</th>
				<th width="10%" align="center">详情</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="dealerApply" varStatus="status">
				<td>${status.count}</td>
				<td>${dealerApply.member.name}</td>
				<td>${dealerApply.member.mobile}</td>
				<td>${dealerApply.member.dealer.dealerLevel.level}</td>
				<td>${dealerApply.dealerLevel.level}</td>
				<c:if test="${dealerApply.state == 1}">
				<td>通过</td>
				</c:if>
				<c:if test="${dealerApply.state == 21}">
				<td>待审核</td>
				</c:if>
				<c:if test="${dealerApply.state == 2}">
				<td>审核不通过</td>
				</c:if>
				<c:if test="${dealerApply.state !=1 && dealerApply.state !=21 && dealerApply.state !=2 }">
				<td>未知</td>
				</c:if>
				<td><fmt:formatDate value="${dealerApply.createdAt}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td> <a title="申请详情" target="dialog" width="1000" height="600" rel="dealerApply_detail" href="${rootUrl}/member/dealer-apply!details?id=${dealerApply.id}" >申请详情</a>
				 <a title="会员详情" target="dialog" width="1000" height="600" rel="member_detail" href="${rootUrl}/member/member!detail?id=${dealerApply.member.id}" >会员详情</a></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>